/**
 * 广寒宫
 * 网址:www.guanghangong.xyz
 */
package org.moon.framework.autoconfigure.exception.domain;

import lombok.Getter;
import lombok.Setter;
import org.moon.framework.autoconfigure.springmvc.response.RCode;

/**
 * 框架异常
 * @author moon
 *
 */
@Getter
@Setter
public class MoonException extends RuntimeException {

    private int code;
    private String msg;

    public MoonException(String msg) {
        super(msg);
        this.code = RCode.FAIL.getCode();
        this.msg = msg;
    }
    public MoonException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
    public MoonException(Exception e) {
        super(e);
        this.code = 500;
        this.msg = e.getMessage();
    }

    public MoonException(int code, String msg, Throwable t) {
        super(msg, t);
        this.code = code;
        this.msg = msg;
    }
}
